package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.SupplierCategoryMapper;
import com.ruoyi.business.domain.SupplierCategory;
import com.ruoyi.business.service.ISupplierCategoryService;

/**
 * 供应商树形Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-20
 */
@Service
public class SupplierCategoryServiceImpl implements ISupplierCategoryService 
{
    @Autowired
    private SupplierCategoryMapper supplierCategoryMapper;

    /**
     * 查询供应商树形
     * 
     * @param id 供应商树形主键
     * @return 供应商树形
     */
    @Override
    public SupplierCategory selectSupplierCategoryById(Long id)
    {
        return supplierCategoryMapper.selectSupplierCategoryById(id);
    }

    /**
     * 查询供应商树形列表
     * 
     * @param supplierCategory 供应商树形
     * @return 供应商树形
     */
    @Override
    public List<SupplierCategory> selectSupplierCategoryList(SupplierCategory supplierCategory)
    {
        return supplierCategoryMapper.selectSupplierCategoryList(supplierCategory);
    }

    /**
     * 新增供应商树形
     * 
     * @param supplierCategory 供应商树形
     * @return 结果
     */
    @Override
    public int insertSupplierCategory(SupplierCategory supplierCategory)
    {
        supplierCategory.setCreateTime(DateUtils.getNowDate());
        return supplierCategoryMapper.insertSupplierCategory(supplierCategory);
    }

    /**
     * 修改供应商树形
     * 
     * @param supplierCategory 供应商树形
     * @return 结果
     */
    @Override
    public int updateSupplierCategory(SupplierCategory supplierCategory)
    {
        supplierCategory.setUpdateTime(DateUtils.getNowDate());
        return supplierCategoryMapper.updateSupplierCategory(supplierCategory);
    }

    /**
     * 批量删除供应商树形
     * 
     * @param ids 需要删除的供应商树形主键
     * @return 结果
     */
    @Override
    public int deleteSupplierCategoryByIds(Long[] ids)
    {
        return supplierCategoryMapper.deleteSupplierCategoryByIds(ids);
    }

    /**
     * 删除供应商树形信息
     * 
     * @param id 供应商树形主键
     * @return 结果
     */
    @Override
    public int deleteSupplierCategoryById(Long id)
    {
        return supplierCategoryMapper.deleteSupplierCategoryById(id);
    }
}
